package com.yunhe.util;

import java.io.IOException;
import java.io.InputStream;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

public class MySession {
		public static SqlSession getSession(){
			InputStream in;
			SqlSession os=null;
			try {
				in = Resources.getResourceAsStream("SqlMapConfig.xml");
				SqlSessionFactory build = new SqlSessionFactoryBuilder().build(in);			
				os = build.openSession();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			return os;
		}

	
}
